<?php
header("content-type:text/html;charset=utf-8");

$db=new mysqli("localhost","root","root","mogujie");

$product_name=$_POST["product_name"];
$product_price=$_POST["product_price"];
$product_num=$_POST["product_num"];
$product_src=$_POST["product_src"];
$product_size=$_POST["product_size"];
$product_type=$_POST["product_type"];

$sql="INSERT INTO add_product (product_name,product_price,product_num,product_src,product_size,type) VALUES ('${product_name}',$product_price,$product_num,'${product_src}',$product_size,'${product_type}')";

$flag=$db->query($sql);
if($flag){
    echo '{"ok":true}';
}else{
    echo '{"ok":false}';
}
?>